package com.wgchao.identityrightsmanagement.infrastructure.jpa.repository;

import com.wgchao.identityrightsmanagement.infrastructure.jpa.entity.SysBaseAccountOffice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysBaseAccountOfficeRepository extends JpaRepository<SysBaseAccountOffice, Long> {

    void deleteAllByUsername(String username);

    List<SysBaseAccountOffice> findAllByUsername(String username);

    void deleteAllByOfficeCode(String officeCode);

    List<SysBaseAccountOffice> findAllByOfficeCode(String officeCode);

    void deleteAllByDepartmentCode(String departmentCode);

    List<SysBaseAccountOffice> findAllByDepartmentCode(String departmentCode);

    void deleteAllByDepartmentCodeAndOfficeCodeNotIn(String departmentCode, List<String> officeCodes);
}
